package com.hq.talk.common;

import android.text.TextUtils;

import java.util.Set;

public class Session {

    /**
     * 用户是否是第一次安装APP true 是的 false不是
     */
    public static boolean user_first_install;

    /**
     * 记录app版本号
     */
    public static String app_version;

    /**
     * 用户是否登录 true 登录 false 未登录
     */
    public static boolean user_islogin;

    /**
     * 用户id
     */
    public static String user_id;

    /**
     * token
     */
    public static String user_token;

    /**
     * 用户头像
     */
    public static String user_head;

    /**
     * 用户昵称
     */
    public static String user_name;

    /**
     * 用户签名
     */
    public static String user_sign;

    /**
     * 用户手机号
     */
    public static String user_phone;

    /**
     * 用户性别
     */
    public static String user_sex;
    /**
     * 省
     */
    public static String user_province;
    /**
     * 市
     */
    public static String user_city;
    /**
     * 区
     */
    public static String user_district;


    public static String getAppVersion() {
        return SysSharePres.getInstance().getAppVersion();
    }

    public static void setAppVersion(String app_version) {
        SysSharePres.getInstance().setAppVersion(app_version);
    }

    public static boolean getUserFirstInstall() {
        return SysSharePres.getInstance().getUserFirstInstall();
    }

    public static void setUserFirstInstall(boolean user_first_install) {
        SysSharePres.getInstance().setUserFirstInstall(user_first_install);
    }

    public static boolean getUserIsLogin() {
        return SysSharePres.getInstance().getUserIsLogin();
    }

    public static void setUserIsLogin(boolean user_islogin) {
        SysSharePres.getInstance().setUserIsLogin(user_islogin);
    }

    public static String getUserId() {
        return SysSharePres.getInstance().getUserId();
    }

    public static void setUserId(String user_id) {
        SysSharePres.getInstance().setUserId(user_id);
    }

    public static String getUserToken() {
        return SysSharePres.getInstance().getUserToken();
    }

    public static void setUserToken(String user_token) {
        SysSharePres.getInstance().setUserToken(user_token);
    }

    public static String getUserHead() {
        return SysSharePres.getInstance().getUserHead();
    }

    public static void setUserHead(String user_head) {
        SysSharePres.getInstance().setUserHead(user_head);
    }

    public static String getUserName() {
        return SysSharePres.getInstance().getUserName();
    }

    public static void setUserName(String user_name) {
        SysSharePres.getInstance().setUserName(user_name);
    }

    public static String getUserSign() {
        return SysSharePres.getInstance().getUserSign();
    }

    public static void setUserSign(String user_sign) {
        SysSharePres.getInstance().setUserSign(user_sign);
    }

    public static String getUserPhone() {
        return SysSharePres.getInstance().getUserPhone();
    }

    public static void setUserPhone(String user_phone) {
        SysSharePres.getInstance().setUserPhone(user_phone);
    }

    public static String getUserSex() {
        return SysSharePres.getInstance().getUserSex();
    }

    public static void setUserSex(String user_sex) {
        SysSharePres.getInstance().setUserSex(user_sex);
    }

    public static String getUserProvince() {
        return SysSharePres.getInstance().getUserProvince();
    }

    public static void setUserProvince(String user_province) {
        SysSharePres.getInstance().setUserProvince(user_province);
    }

    public static String getUserCity() {
        return SysSharePres.getInstance().getUserCity();
    }

    public static void setUserCity(String user_city) {
        SysSharePres.getInstance().setUserCity(user_city);
    }

    public static String getUserDistrict() {
        return SysSharePres.getInstance().getUserProvince();
    }

    public static void setUserDistrict(String user_district) {
        SysSharePres.getInstance().setUserDistrict(user_district);
    }


    //版本更新時清理数据
    public static void clearMust() {
        Session.setUserFirstInstall(false);
        Session.setAppVersion("");
    }

    /**
     * 退出登录,清除信息
     */
    public static void clearExit() {
        Session.setUserIsLogin(false);
        Session.setUserId("");
        Session.setUserHead("");
        Session.setUserName("");
        Session.setUserSign("");
        Session.setUserPhone("");
        Session.setUserSex("1");
        Session.setUserProvince("");
        Session.setUserCity("");
        Session.setUserDistrict("");

    }

}
